<template>
  <div class="main_content">
    <div class="pic">
      <img :src="value.img_url" alt="" />
    </div>
    <div class="title">
      <h2>{{ value.title }}</h2>
    </div>
    <div class="price">
      <div class="money">
        <span>￥{{ value.sell_price }}</span>
        <span>{{ value.market_price }}</span>
      </div>

      <div class="text">
        <span>热卖中</span>
        <span>还剩{{ value.stock_quantity }}件</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    value: {
      type: Object,
      require: true,
    },
  },
};
</script>

<style lang="less" scoped>
.main_content {
  width: 49%;
  padding: 20px 10px;
  box-sizing: border-box;
  box-shadow: 0 0 5px 2px rgba(218, 218, 218, 0.445);
  margin-bottom: 10px;
  .pic {
    // height: 170px;
    // background-color: antiquewhite;
    img {
      width: 100%;
    }
  }
  .title h2 {
    font-size: 16px;
    margin: 10px 0;

    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    word-wrap: break-word;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .price {
    padding: 10px 5px 5px;
    background-color: rgb(235, 235, 235);
    .money span {
      &:first-child {
        color: red;
        font-size: 18px;
      }
      &:last-child {
        color: #666;
        text-decoration: line-through;
        margin-left: 20px;
      }
    }

    .text {
      margin-top: 20px;
      display: flex;
      justify-content: space-between;
    }
  }
}
</style>